package us.ohec.utils {
  public class StringUtil {
    public static function toTitleCase(value:String): String {
      var words:Array = value.split(" ");

      for (var i:int = 0; i < words.length; i++) {
        words[i] = toUCFirst(words[i]);
      }
      return (words.join(" "));
    }

    public static function toUCFirst(value:String): String {
      return value.charAt(0).toUpperCase() + value.substr(1).toLowerCase();
    }
  }
}